import matplotlib.pyplot as plt
from sklearn.datasets import make_blobs
from sklearn.cluster import KMeans
from sklearn.metrics import silhouette_score
import os
os.environ["OMP_NUM_THREADS"] = "1"

X, y = make_blobs(n_samples=1000, n_features= 2,
                  centers=[[-1,-1],[0,0],[1,1],[2,2]], cluster_std=[0.4,0.4,0.2,0.2], random_state=9)

y_predict = KMeans(n_clusters=2, random_state=9).fit_predict(X)
plt.scatter(X[:, 0], X[:, 1], marker='o', c=y_predict)
plt.show()

print(silhouette_score(X,y_predict))